#pragma once
#include "hardware_buffer.h"

namespace krryn{
namespace view{
	enum index_buffer_format{
		index_16bit,
		index_32bit
	};

	class index_buffer : public hardware_buffer{
	public:
		index_buffer(size_t a_NumberOfIndices, index_buffer_format a_Format)
			: m_NumberOfIndices(a_NumberOfIndices), m_Format(a_Format), hardware_buffer(0)
		{
			if(a_Format == index_16bit){
				m_SizeInBytes = sizeof(unsigned short);
			} else if(a_Format == index_32bit){
				m_SizeInBytes = sizeof(unsigned int);
			}

			m_SizeInBytes *= m_NumberOfIndices;
		}

		virtual ~index_buffer() {}

		index_buffer_format get_index_buffer_format() const { return m_Format; }
		size_t get_number_of_indices() const { return m_NumberOfIndices; }

	private:
		size_t m_NumberOfIndices;
		index_buffer_format m_Format;
	};
}
}